home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 2207 / 2207.xpi / chrome / cooliris.jar / content / cooliris / bindings / cpvwBinding.xml
Extensible Markup Language  |  2010-01-14  |  21KB  |  469 lines

  1. <?xml version="1.0"?>
  2. <bindings xmlns="http://www.mozilla.org/xbl"
  3.     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  4.     xmlns:xbl="http://www.mozilla.org/xbl"
  5.     xmlns:html = "http://www.w3.org/1999/xhtml">
  6.     
  7.     <binding id="cpvwFrame">
  8.         <resources>
  9.             <stylesheet src="chrome://cooliris/skin/cooliris.css"/>
  10.         </resources>
  11.         <content>
  12.             <xul:stack>
  13.                 <xul:browser position="1" style="background-color: transparent;"/>
  14.                 <xul:vbox anonid="cooliris-border-frame" flex="1" xbl:inherits="class=skin" style="margin:1px;">
  15.                     <xul:vbox anonid="cooliris-toolbar" flex="1" class="cooliris-toolbar">                
  16.                         <xul:hbox anonid="cooliris-preview-toolbar" xbl:inherits="skin" class="cooliris-preview-toolbar" onmousedown="document.getBindingParent(this).startFrameDrag(event);" >                        
  17.                             <xul:spacer width="5px"/>
  18.                             <xul:image  class="cooliris_logo" style="cursor:pointer;" ondblclick="cpvw_previewHandler.openCoolirisWebsite(event);"/>
  19.                             <xul:spacer width="12px"/>
  20.                         
  21.                             <xul:image id="cooliris_btnBack" height="21px" style="height:21px;" xbl:inherits="goBack=goBack" class="cooliris_btnBack" tooltiptext="Go back" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" onclick="cpvw_previewHandler.goBack(event);"/>
  22.                             <xul:image  id="cooliris_next" class="cooliris_next" xbl:inherits="goForward=goForward" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" tooltiptext="Go forward" onclick="cpvw_previewHandler.gotoNextLink();"/>                            
  23.                             <xul:spacer width="5px"/>
  24.                             <xul:image  id="cooliris_openTab" class="cooliris_openTab" tooltiptext="Open to tab"  onclick="cpvw_previewHandler.openLink(event);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
  25.                             <xul:image id="cooliris_stack"  class="cooliris_stack" tooltiptext="Temporary bookmark to stack" onclick="this.removeAttribute('clicked');cpvw_previewHandler.addToStack();" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
  26.                         
  27.                             <xul:image id="cooliris_openPiclensLite" class="cooliris_piclenslite" xbl:inherits="hasCooliris=hasCooliris,tooltiptext=slideshowTip" onclick="setTimeout(function(){cpvw_previewHandler.openPiclensLite();}, 100);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />    
  28.                             <xul:spacer width="5px"/>
  29.                             <xul:image id="cooliris_sendToButton" class="cooliris_sendToButton" tooltiptext="Email current link"  onclick="CoolirisFramePanel.showSendTo(event, true);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
  30.                             <xul:spacer width="8px"/>
  31.                             <xul:image id="cooliris_zoom" class="cooliris_zoom" popup="cooliris_zoom_popup" tooltiptext="Zoom in/out" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />                
  32.                             <xul:image id="cooliris_useroptions"  class="cooliris_useroptions" tooltiptext="Customize speed, theme, and settings" onclick="cpvw_Prefs.showPrefDialog(event);" onmousedown="this.setAttribute('clicked', true)" onmouseup="this.removeAttribute('clicked')" />
  33.     
  34.                             <xul:spacer flex="1"/>
  35.                         
  36.                             <xul:spacer width="5px"/>
  37.                             <xul:image anonid="cooliris_pushPin" class="cooliris_pushPin" tooltiptext="Keep preview window open" onclick="cpvw_previewHandler.togglePushPin();"/>                        
  38.                             <xul:image  id="cooliris_close" class="cooliris_close" tooltiptext="Close the preview" onclick="cpvw_previewHandler.hidePreview(true);"/>
  39.                             <xul:spacer width="3px"/>
  40.                         </xul:hbox>
  41.                         <xul:hbox anonid="subSearchBar" xbl:inherits="skin" class="subSearchBar" hidden="true">
  42.                             <xul:hbox class="subSearchWord">
  43.                                 <xul:hbox class="searchTextImage">
  44.                                     <xul:textbox anonid="subSearchBarText" class="subSearchText" onkeypress="if (event.keyCode == 13) cpvw_subSearchBar.doSearch();" ></xul:textbox>
  45.                                 </xul:hbox> 
  46.                                 <!--<xul:label class="subSearchLabel" value="Search for"></xul:label>
  47.                                     <xul:label class="subSearchLabel" style="margin-left:0px;min-width:20px;max-width:80px;font-weight:bold;" crop="end" anonid="subSearchBarLabel" value=""></xul:label>
  48.                                     <xul:label class="subSearchLabel" style="margin-left:0px;" value="in:"></xul:label>
  49.                                     -->
  50.                             </xul:hbox>
  51.                             <xul:hbox anonid="subSearchBarContent">                        
  52.                             
  53.                             </xul:hbox>
  54.                             <xul:spacer flex="1"/>
  55.                             <xul:label id="cooliris_subsearch_close" class="subSearchButton" style="margin-left:0px;" value="Close" tooltiptext="Hide the QuickSearch bar" onclick="document.getBindingParent(this).toggleSearchBar(false, '');"/>
  56.                         </xul:hbox>
  57.                     </xul:vbox>                
  58.                     <xul:hbox anonid="browser-box" flex="1">
  59.                         <xul:hbox>
  60.                             <xul:browser hidden="true" style="width:0px;height:0px;margin-right:1px;" src="" class="cooliris-browser" anonid="cpvw_leftAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
  61.                         </xul:hbox>
  62.                         <xul:vbox flex="1">                        
  63.                             <xul:browser hidden="true" style="width:0px;height:0px;margin-bottom:2px;" src="" class="cooliris-browser" anonid="cpvw_topAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>                                
  64.                             <xul:browser class="cooliris-browser" anonid="cooliris-preview-frame" disablehistory="false" type="content" context="contentAreaContextMenu"/>                        
  65.                             <xul:browser hidden="true" class="cooliris-browser" style="width:0px;height:0px;margin-top:1px;" src="" anonid="cpvw_bottomAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
  66.                             <xul:browser style="width:0px;height:0px;" src="" xbl:inherits="src=statsUrl" class="cooliris-browser" anonid="cpvw_statsFrame" disablehistory="false" type="content" />
  67.                         </xul:vbox>
  68.                         <xul:hbox>
  69.                             <xul:browser hidden="true" style="width:0px;height:0px;margin-left:1px;" src="" class="cooliris-browser" anonid="cpvw_rightAdFrame" disablehistory="false" type="content" context="contentAreaContextMenu"/>
  70.                         </xul:hbox>    
  71.                     </xul:hbox>
  72.                 
  73.                     <xul:hbox  class="cooliris-statusbar" anonid="cooliris_statusbar" flex="1" onmousedown="cpvw_previewHandler.startFrameDrag(event);">
  74.                         <xul:image id="cooliris-preview-resize-left" class="cooliris_resize_left"   onmousedown="cpvw_previewHandler.startResizeLeft(event);event.preventDefault();event.stopPropagation();"/>
  75.                         <xul:spacer flex="1"/>
  76.                         <xul:image id="cooliris-preview-resize"  class="cooliris_resize_right"   onmousedown="cpvw_previewHandler.startResize(event);event.preventDefault();event.stopPropagation();"/>
  77.                     </xul:hbox>
  78.                 </xul:vbox>
  79.             </xul:stack>
  80.         </content>
  81.         
  82.         <implementation>
  83.             <method name="_get">
  84.                 <parameter name="elName"/>
  85.                 <body>
  86.                     return document.getAnonymousElementByAttribute(this, "anonid", elName);
  87.                 </body>
  88.             </method>
  89.             <method name="setBgImage">
  90.                 <parameter name="url"/>
  91.                 <body>
  92.                     document.getAnonymousElementByAttribute(this, "anonid", "cooliris-preview-toolbar").style.backgroundImage = "url(" + url + ")";
  93.                     document.getAnonymousElementByAttribute(this, "anonid", "cooliris-preview-toolbar").style.backgroundRepeat = "repeat-x";
  94.                 </body>
  95.             </method>
  96.             <field name="_pushPin"/>
  97.             <property name="pushPin">
  98.                 <getter>return this._pushPin;</getter>
  99.                 <setter>
  100.                     this._pushPin = val;
  101.                     if (val)
  102.                         this._get("cooliris_pushPin").setAttribute("locked", "yes");
  103.                     else
  104.                         this._get("cooliris_pushPin").removeAttribute("locked");
  105.                 </setter>
  106.             </property>
  107.             <field name="_forwardButtonDisabled"/>
  108.             <property name="forwardButtonDisabled">
  109.                 <getter>return this._forwardButtonDisabled;</getter>
  110.                 <setter>
  111.                     this._forwardButtonDisabled = val;
  112.                     if (val)
  113.                         this._get("cooliris_next").setAttribute("disable", val);
  114.                     else
  115.                         this._get("cooliris_next").removeAttribute("disable");
  116.                 </setter>
  117.             </property>
  118.             <property name="showSearchBar">
  119.                 <getter>return _showSearchBar;</getter>
  120.                 <setter>this._showSearchBar = val;</setter>
  121.             </property>
  122.             <field name="_showSearchBar"></field>
  123.             <method name="toggleSearchBar">
  124.                 <parameter name="show"/>
  125.                 <parameter name="searchString"/>
  126.                 <body>
  127.                 <![CDATA[
  128.                     this._showSearchBar = show;
  129.                     this._get("subSearchBar").hidden = !show;
  130.                     cpvw_subSearchBar.toDisplaySearchBar = show;
  131.                     if (this.isShowing)
  132.                     {
  133.                         //if (searchString.length > 20)
  134.                         //    searchString = searchString.substr(0, 20);
  135.                         this._get("subSearchBarText").value = searchString;
  136.                         this.showPopup(this.previewLeft, this.previewTop, this.previewWidth, this.previewHeight);
  137.                     }
  138.                 ]]>
  139.                 </body>
  140.             </method>            
  141.             <method name="getPreviewFrame">
  142.                 <body>
  143.                     return this._get("cooliris-preview-frame");
  144.                 </body>
  145.             </method>
  146.             <method name="getSearchBarContent">
  147.                 <body>
  148.                     return this._get("subSearchBarContent");
  149.                 </body>
  150.             </method>
  151.             <method name="getSearchText">
  152.                 <body>
  153.                     return this._get("subSearchBarText").value;
  154.                 </body>
  155.             </method>
  156.             <method name="setStatsUrl">
  157.                 <parameter name="url"/>
  158.                 <body>
  159.                     this._get("cpvw_statsFrame").loadURI(url);
  160.                 </body>
  161.             </method>
  162.             <method name="statsUrlReload">                
  163.                 <body>
  164.                     this._get("cpvw_statsFrame").reload();
  165.                 </body>
  166.             </method>
  167.             <method name="setPosition">
  168.                 <parameter name="elName"/>
  169.                 <parameter name="left"/>
  170.                 <parameter name="top"/>
  171.                 <parameter name="width"/>
  172.                 <parameter name="height"/>
  173.                 <body>
  174.                     obj = document.getAnonymousElementByAttribute(this, "anonid", elName);
  175.                     if (left)
  176.                         obj.style.left = left + "px";
  177.                     if (top)
  178.                         obj.style.top = top + "px";
  179.                     if (width)
  180.                         obj.style.width = width + "px";
  181.                     if (height)
  182.                         obj.style.height = height + "px";
  183.                 </body>
  184.             </method>
  185.             <field name="leftAdFrameSize">0</field>            
  186.             <field name="rightAdFrameSize">0</field>
  187.             <field name="topAdFrameSize">0</field>
  188.             <field name="bottomAdFrameSize">0</field>
  189.             
  190.             <field name="previewLeft"></field>
  191.             <field name="previewTop"></field>
  192.             <field name="previewWidth"></field>
  193.             <field name="previewHeight"></field>
  194.             <field name="isShowing"></field>
  195.             <method name="showPopupCollapsed">
  196.                 <parameter name="left"/>
  197.                 <parameter name="top"/>
  198.                 <parameter name="width"/>
  199.                 <parameter name="height"/>
  200.                 <body>
  201.                     this.hidden = false;
  202.                     this.style.display = "block";
  203.                     
  204.                     this.style.left = left + "px";
  205.                     this.style.top = top + "px";
  206.                     this.style.width = width + "px";
  207.                     this.style.height = height + "px";
  208.             
  209.                     var iframeHeight = 1;
  210.                      
  211.                     this.setPosition("cooliris-preview-frame", null, null, width, iframeHeight, true);
  212.                     
  213.                     //conDump("FINAL DIMENSIONS = " + left + ", " + top + ", " + width + ", " + height);                    
  214.                           
  215.                 </body>
  216.             </method>
  217.             <field name="_adVisible"/>
  218.             <method name="showAd">
  219.                 <body>
  220.                 <![CDATA[
  221.                     var adId = cpvw_prefHandler.getPref(cpvw_Prefs.prefAdId); 
  222.                     var strGet = "&adId=" + adId + "&theme=" + cpvw_prefHandler.getPref(cpvw_Prefs.prefTheme) + "&version=" + cpvw_objStats.getAddonVersion(false);    
  223.                     var adUrl = cpvw_adManager.adServer;
  224.                     //conDump("adframesize " + [this.leftAdFrameSize, this.rightAdFrameSize, this.topAdFrameSize, this.bottomAdFrameSize].join(", "));
  225.                     this._adVisible = true;
  226.                     this.showPopup(this.previewLeft, this.previewTop, this.previewWidth, this.previewHeight);
  227.  
  228.                     if (this.leftAdFrameSize > 0)
  229.                     {
  230.                         this._get("cpvw_leftAdFrame").setAttribute("src", adUrl + "?loc=left" + strGet);
  231.                         this._get("cpvw_leftAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
  232.                     }
  233.                     else
  234.                     {
  235.                         this._get("cpvw_leftAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  236.                         this._get("cpvw_leftAdFrame").hidden = true;
  237.                     }
  238.                     if (this.rightAdFrameSize > 0)
  239.                     {
  240.                         this._get("cpvw_rightAdFrame").setAttribute("src", adUrl + "?loc=right" + strGet);
  241.                         this._get("cpvw_rightAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);
  242.                     }
  243.                     else
  244.                     {
  245.                         this._get("cpvw_rightAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  246.                         this._get("cpvw_rightAdFrame").hidden = true;
  247.                     }                    
  248.                     if (this.topAdFrameSize > 0)
  249.                     {
  250.                         this._get("cpvw_topAdFrame").setAttribute("src", adUrl + "?loc=top" + strGet);
  251.                         this._get("cpvw_topAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true); 
  252.                     }
  253.                     else
  254.                     {
  255.                         this._get("cpvw_topAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  256.                         this._get("cpvw_topAdFrame").hidden = true;
  257.                     }
  258.                     if (this.bottomAdFrameSize > 0)
  259.                     {
  260.                         this._get("cpvw_bottomAdFrame").setAttribute("src", adUrl + "?loc=bottom" + strGet);
  261.                         this._get("cpvw_bottomAdFrame").addEventListener("coolpreviewsCloseAdEvent", cpvw_adManager, false, true);                          
  262.                     }
  263.                     else
  264.                     {
  265.                         this._get("cpvw_bottomAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  266.                         this._get("cpvw_bottomAdFrame").hidden = true;
  267.                     }
  268.                 ]]>
  269.                 </body>
  270.             </method>
  271.             <method name="showPopup">
  272.                 <parameter name="left"/>
  273.                 <parameter name="top"/>
  274.                 <parameter name="width"/>
  275.                 <parameter name="height"/>
  276.                 <parameter name="showAd"/>
  277.                 <body>
  278.                 <![CDATA[
  279.  
  280.                     this.hidden = false;
  281.                     this.style.display = "block";
  282.  
  283.                     this.style.left = left + "px";
  284.                     this.style.top = top + "px";
  285.                     this.style.width = width + "px";
  286.                     this.style.height = height + "px";
  287.  
  288.                     this.previewLeft = left;
  289.                     this.previewTop = top;
  290.                     this.previewWidth = width;
  291.                     this.previewHeight = height;
  292.  
  293.                     var browserWidth = width;
  294.                     var actualBrowserWidth = width; 
  295.                     var actualBrowserHeight = this._showSearchBar ? height - 70 : height - 43;                    
  296.                     var browserHeight = this._showSearchBar ? height - 70 : height - 43; 
  297.  
  298.                     var adFrameHeight, adFrameWidth;
  299.                     if (this._adVisible)
  300.                     {
  301.                         if (this.leftAdFrameSize > 0)
  302.                         {
  303.                             this._get("cpvw_leftAdFrame").hidden = false;                        
  304.                             //setTimeout(function(){ self._get("cpvw_leftAdFrame").setAttribute("src", adUrl + "?loc=left" + strGet); }, 500);
  305.                             browserWidth = browserWidth - parseInt(this.leftAdFrameSize) - 1;
  306.  
  307.                             adFrameHeight = actualBrowserHeight;
  308.                             <!--if (this.topAdFrameSize > 0)
  309.                                 adFrameHeight = this.topAdFrameSize - 1;
  310.                             if (this.bottomAdFrameSize > 0)
  311.                                 adFrameHeight = this.bottomAdFrameSize - 1;
  312.                             -->                                                                                   
  313.                             this.setPosition("cpvw_leftAdFrame", null, null, this.leftAdFrameSize, adFrameHeight); 
  314.                         }
  315.                         if (this.rightAdFrameSize > 0)
  316.                         {
  317.                             this._get("cpvw_rightAdFrame").hidden = false;
  318.                             //setTimeout(function(){ self._get("cpvw_rightAdFrame").setAttribute("src", adUrl + "?loc=right" + strGet); }, 500);
  319.  
  320.                             browserWidth = browserWidth - parseInt(this.rightAdFrameSize) - 1;
  321.                             adFrameHeight = actualBrowserHeight;
  322.                             <!--if (this.topAdFrameSize > 0)
  323.                                 adFrameHeight = this.topAdFrameSize - 1;
  324.                             if (this.bottomAdFrameSize > 0)
  325.                                 adFrameHeight = this.bottomAdFrameSize - 1;
  326.                             -->    
  327.                             this.setPosition("cpvw_rightAdFrame", null, null, this.rightAdFrameSize, adFrameHeight); 
  328.                         }                    
  329.                         if (this.topAdFrameSize > 0)
  330.                         {
  331.                             this._get("cpvw_topAdFrame").hidden = false;
  332.                             //setTimeout(function(){ self._get("cpvw_topAdFrame").setAttribute("src", adUrl + "?loc=top" + strGet); }, 500);
  333.  
  334.                             browserHeight = browserHeight - parseInt(this.topAdFrameSize) - 1;
  335.  
  336.                             adFrameWidth = actualBrowserWidth;
  337.                             if (this.leftAdFrameSize > 0)
  338.                                 adFrameWidth = this.leftAdFrameSize - 1;
  339.                             if (this.rightAdFrameSize > 0)
  340.                                 adFrameWidth = this.rightAdFrameSize - 1;
  341.  
  342.                             this.setPosition("cpvw_topAdFrame", null, null, adFrameWidth, this.topAdFrameSize); 
  343.                         }
  344.                         if (this.bottomAdFrameSize > 0)
  345.                         {
  346.                             this._get("cpvw_bottomAdFrame").hidden = false;
  347.                             //setTimeout(function(){ self._get("cpvw_bottomAdFrame").setAttribute("src", adUrl + "?loc=bottom" + strGet); }, 500);
  348.  
  349.                             browserHeight = browserHeight - parseInt(this.bottomAdFrameSize) - 1;
  350.                             adFrameWidth = actualBrowserWidth;
  351.                             if (this.leftAdFrameSize > 0)
  352.                                 adFrameWidth = this.leftAdFrameSize - 1;
  353.                             if (this.rightAdFrameSize > 0)
  354.                                 adFrameWidth = this.rightAdFrameSize - 1;
  355.  
  356.                             this.setPosition("cpvw_bottomAdFrame", null, null, adFrameWidth, this.bottomAdFrameSize); 
  357.                         }                    
  358.                     }                    
  359.                      
  360.                     this.isShowing = true; 
  361.                     this.setPosition("cooliris-preview-frame", null, null, browserWidth, browserHeight, true);
  362.  
  363.                     //conDump("FINAL DIMENSIONS = " + left + ", " + top + ", " + width + ", " + height + ", " + browserHeight);                    
  364.                 ]]>          
  365.                 </body>
  366.             </method>
  367.             <method name="hidePopup">
  368.                 <body>
  369.                     if (this._adVisible)
  370.                     {
  371.                         if (this.leftAdFrameSize > 0)
  372.                         {                        
  373.                             this._get("cpvw_leftAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  374.                             this._get("cpvw_leftAdFrame").hidden = true;
  375.                         }
  376.                         if (this.rightAdFrameSize > 0)
  377.                         {
  378.                                             
  379.                             this._get("cpvw_rightAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  380.                             this._get("cpvw_rightAdFrame").hidden = true;
  381.                         }                    
  382.                         if (this.topAdFrameSize > 0)
  383.                         {                        
  384.                             this._get("cpvw_topAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  385.                             this._get("cpvw_topAdFrame").hidden = true;
  386.                         }
  387.                         if (this.bottomAdFrameSize > 0)
  388.                         {
  389.                             this._get("cpvw_bottomAdFrame").setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  390.                             this._get("cpvw_bottomAdFrame").hidden = true;                                                  
  391.                         }
  392.                     }
  393.                     this._adVisible = false;
  394.                     var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
  395.                     .getService(Components.interfaces.nsIXULAppInfo);
  396.                     var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
  397.                             .getService(Components.interfaces.nsIVersionComparator);
  398.                     if (versionChecker.compare(appInfo.version, "3.0") >= 0) 
  399.                         this.getPreviewFrame().loadURI("chrome://cooliris/content/coolirisBlank.htm");        
  400.                     else
  401.                         this.getPreviewFrame().setAttribute("src", "chrome://cooliris/content/coolirisBlank.htm");
  402.                     this._get("cpvw_statsFrame").loadURI("chrome://cooliris/content/coolirisBlank.htm");
  403.                     //this.getPreviewFrame().loadURI("chrome://cooliris/content/coolirisBlank.htm");
  404.                     this.isShowing = false;
  405.                     this.hidden = true;
  406.                     
  407.                     this.style.display = "none";                    
  408.                     
  409.                 </body>
  410.             </method>
  411.             <field name="dragActive"/>
  412.             <field name="moveFrameFunc"/>
  413.             <field name="stopFrameFunc"/>
  414.             <method name="startFrameDrag">
  415.                 <parameter name="evt"/>
  416.                 <body>
  417.                     if (this.dragActive)
  418.                         return;
  419.                     cpvw_previewHandler.curMouseLocX = evt.screenX;
  420.                     cpvw_previewHandler.curMouseLocY = evt.screenY;
  421.                     this._get("cooliris-toolbar").style.cursor = "-moz-grabbing";
  422.                     this._get("cooliris_statusbar").style.cursor = "-moz-grabbing";
  423.                     var self = this;
  424.                     this.moveFrameFunc = function(evt){ self.moveFrame(evt); };
  425.                     this.stopFrameFunc = function(evt){ self.stopFrameDrag(evt); };
  426.                     
  427.                     window.addEventListener("mouseup", this.stopFrameFunc, true);
  428.                     window.addEventListener("mousemove", this.moveFrameFunc, true);
  429.             
  430.                     this.dragActive = true;    
  431.                 </body>
  432.             </method>        
  433.             <method name="stopFrameDrag">
  434.                 <parameter name="evt"/>
  435.                 <body>
  436.                     if (!this.dragActive)
  437.                         return;
  438.                     
  439.                     window.removeEventListener("mouseup", this.stopFrameFunc, true);
  440.                     window.removeEventListener("mousemove", this.moveFrameFunc, true);
  441.             
  442.                     cpvw_previewHandler.changeDimensions(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top,
  443.                             cpvw_previewHandler.dimPreview.width, cpvw_previewHandler.dimPreview.height, true);
  444.                     this._get("cooliris-toolbar").style.cursor = "";
  445.                     this._get("cooliris_statusbar").style.cursor = "";
  446.                     cpvw_Prefs.setPreviewLoc(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top);
  447.                     this.dragActive = false;
  448.                 </body>
  449.             </method>
  450.             <method name="moveFrame">
  451.                 <parameter name="evt"/>
  452.                 <body>
  453.                     if (!this.dragActive)
  454.                         return;
  455.                     cpvw_previewHandler.dimPreview.left += evt.screenX - cpvw_previewHandler.curMouseLocX;
  456.                     cpvw_previewHandler.dimPreview.top += evt.screenY - cpvw_previewHandler.curMouseLocY;
  457.             
  458.                     cpvw_previewHandler.curMouseLocX = evt.screenX;
  459.                     cpvw_previewHandler.curMouseLocY = evt.screenY;
  460.             
  461.                     cpvw_previewHandler.changeDimensions(cpvw_previewHandler.dimPreview.left, cpvw_previewHandler.dimPreview.top,
  462.                             cpvw_previewHandler.dimPreview.width, cpvw_previewHandler.dimPreview.height, true);
  463.                 </body>
  464.             </method>
  465.         </implementation>
  466.         <handlers>
  467.         </handlers>
  468.     </binding>    
  469. </bindings>